local a = CreateFrame("Frame")
local orig = ChatFrame_MessageEventHandler
local zone = GetZoneText()
local capitals = {	
	["Shattrath City"] = true, 
	["Undercity"] = true,
	["Thunder Bluff"] = true,
	["Orgrimmar"] = true,
	["Ironforge"] = true,
	["Stormwind"] = true,
	["Darnassus"] = true
}
--[[Hook chat and remove General Chat / trade / defense when not in cities]]
function ChatFrame_MessageEventHandler(event, ...)
	if not capitals[zone] then
		if event == "CHAT_MSG_CHANNEL" then
			if arg4:match("General") then --Filter general
			elseif arg4:match("Trade") then --filter trade Dont think you have trade outside anyway.
			elseif arg4:match("Defense") then --filter defense
			else 
				orig(event, ...)
			end
		else
			orig(event, ...)
		end
		else 
			orig(event, ...)
	end
end

a:SetScript("OnEvent", function(self, event, ...)
	if event == "ZONE_CHANGED_NEW_AREA" then
		zone = GetZoneText()
	end
end)

a:RegisterEvent("ZONE_CHANGED_NEW_AREA")